package com.mercycrazy.recruit.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 用户信息
 *
 * @author <a href="mailto:1443424326@qq.com">mercycrazy</a>
 * @since 2023-01-14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Schema(description = "详细的用户信息")
public class UserInfo implements Serializable {

    @Schema(description = "用户表主键 id")
    private String id;

    @Schema(description = "手机号")
    private String mobile;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "对外展示名, 1: 真实姓名, 2: 昵称")
    private Integer showWhichName;

    @Schema(description = "性别，1:男 0:女 2:保密")
    private Integer sex;

    @Schema(description = "用户头像")
    private String face;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "生日")
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate birthday;

    @Schema(description = "国家")
    private String country;

    @Schema(description = "省份")
    private String province;

    @Schema(description = "城市")
    private String city;

    @Schema(description = "区县")
    private String district;

    @Schema(description = "介绍")
    private String description;

    @Schema(description = "我参加工作的时间")
    @JsonDeserialize(using = LocalDateDeserializer.class)
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate startWorkDate;

    @Schema(description = "我当前职位/职务")
    private String position;

    @Schema(description = "身份角色, 1: 求职者, 2: 求职者可以切换为HR进行招聘, 同时拥有两个身份")
    private Integer role;

    @Schema(description = "成为HR后, 认证的(绑定的)公司主键 id")
    private String hrInWhichCompanyId;

    @Schema(description = "HR 个性签名")
    private String hrSignature;

    @Schema(description = "HR 个性化标签")
    private String hrTags;

    @Schema(description = "创建时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
}
